<template>
	<view class="wrap">
		<view class="art-title">
			{{ article.title }}
		</view>
		<view class="art-content">
			<u-parse :content="article.content" :tagStyle="contentStyle"></u-parse>		
		</view>	
	</view>
</template>

<script>
import { articleDetail } from '@/api/discover.js';	 
export default {
	onLoad(options) {
		if(options.id != undefined) {
			this.article.id = options.id;
			this.init();
		}
	},
	data() {
		return {
			article: {
				id: 0,
				title: '',
				content: ''
			},
			posterStyle: {
				img: "display:block;"
			}
		}
	},
	methods: {
		init() {
			articleDetail(this.article.id).then(res=>{
				this.article = res.data.article;
			});
		}
	}
}	
</script>

<style lang="less" scoped>
.wrap {
	display: flex;
	flex-direction: column;
	padding: 24rpx;
	box-sizing: border-box;
	background: #fefefe;
}
	
.art-title {
	font-size: 20px;
	font-weight: 500;
	color: #000;
}
	
.art-content {
	margin: 35rpx 0;
}	
</style>